<template>
  <div>
    <div>
      <div>
        <span>
            <el-input placeholder="请输入搜索内容" v-model="input2">
          <template slot="append"><el-button @click="sou">搜索</el-button></template>
        </el-input>
        <el-button @click="qb">发布需求匹配人才</el-button>
        </span>
      </div>
      <span v-for="(i, x) in close" :key="x">
        <el-button @click="dj(i.id)">{{ i.name }}</el-button>
      </span>
    </div>

    <el-table :data="lst">
      <el-table-column prop="code" label="编号"> </el-table-column>
      <el-table-column prop="title" label="标题"> </el-table-column>
      <el-table-column prop="described" label="描述"> </el-table-column>
      <el-table-column prop="money" label="金币"> </el-table-column>
      <el-table-column prop="userid" label="雇主"> </el-table-column>
      <el-table-column prop="closeid" label="支付方式"> </el-table-column>
    </el-table>
  </div>
</template>
  
  <script>
export default {
  data() {
    return {
      lst: "",
      close: "",
      input2:""
    };
  },
  mounted() {
    this.sneed();
    this.getclose();
  },
  methods: {
    getclose() {
      this.axios.get("/getclose").then((res) => {
        this.close = res.data.data;
      });
    },
    sneed() {
      this.axios.get("/needall").then((res) => {
        this.lst = res.data.data;
      });
    },
    dj(id) {
      this.axios.get("/need_close?closeid=" + id).then((res) => {
        this.lst = res.data.data;
      });
    },
    qb() {
      this.$router.push("/setneed");
    },
    sou(){
        this.axios.get("/label_index?input="+this.input2).then(res =>{
            this.lst = res.data.data
        })
    }
  },
};
</script>
  
  <style>
</style>